home *** CD-ROM | disk | FTP | other *** search
- #ifndef _qed_memory_h_
- #define _qed_memory_h_
-
- #define NEXT(x) (x=x->nachf)
- #define VORG(x) (x=x->vorg)
- #define TEXT(x) ((UBYTE *)(x) + sizeof(ZEILE))
- #define IS_FIRST(x) ((x->vorg->info&HEAD)!=0)
- #define IS_LAST(x) ((x->nachf->info&TAIL)!=0)
- #define IS_HEAD(x) ((x->info&HEAD)!=0)
- #define IS_TAIL(x) ((x->info&TAIL)!=0)
- #define FIRST(x) ((x)->head.nachf)
- #define LAST(x) ((x)->tail.vorg)
-
- /* Ein Text ist als doppelt verkettete Liste implementiert */
- /* Am Anfang und Ende befindet sich je ein Zeilenkopf der */
- /* auf NULL zeigt */
-
- /*
- * Maximale Länge einer Zeile.
- * Wenn man die verändert -> MAX_ANZ in memory.c!!
- */
- #define MAX_LINE_LEN 255
-
-
- #define MARKED 1
- #define HEAD 8
- #define TAIL 16
- #define ABSATZ 128
-
- typedef struct tzeile
- {
- struct tzeile *vorg; /* 4 Bytes */
- struct tzeile *nachf; /* 4 Bytes */
- UBYTE info; /* 1 Byte */
- UBYTE len; /* 1 Byte */
- } ZEILE, *ZEILENPTR, *LINEP; /* 10 Bytes */
-
- typedef struct
- {
- ZEILE head;
- ZEILE tail;
- LONG lines;
- WORD longest_len; /* Länge der längsten Zeile (0..255) */
- } RING, *RINGPTR, *RINGP;
-
-
- typedef enum {tos, unix, apple, binmode} LineEnding;
-
-
- LINEP col_insert (LINEP wo, LINEP was);
- VOID col_append (RINGP t, LINEP was);
- VOID col_delete (LINEP wo);
- VOID col_concate (LINEP *wo);
- VOID col_split (LINEP *col,WORD pos);
- LINEP new_col_w (CONST UBYTE *str, WORD l);
- LINEP new_col_b (CONST UBYTE *str, WORD l);
- VOID free_col (LINEP col);
- VOID INSERT (LINEP *a, WORD pos, WORD delta, CONST UBYTE *str);
- UBYTE *REALLOC (LINEP *a, WORD pos, WORD delta);
- LINEP get_line (RINGP r, LONG y);
- WORD get_longest_len(RINGP r);
-
- VOID init_textring (RINGP r);
- LONG textring_bytes (RINGP r, LineEnding ending);
- VOID free_textring (RINGP r);
- VOID kill_textring (RINGP r);
- BOOLEAN doppeln (RINGP old, RINGP new);
- BOOLEAN ist_leer (RINGP r);
-
- VOID kill_memory (VOID);
- BOOLEAN is_mem_free (VOID); /* Ohne Meldung */
- BOOLEAN ist_mem_frei (VOID); /* Mit Meldung */
-
- VOID init_memory (VOID);
-
- #endif
-